home *** CD-ROM | disk | FTP | other *** search
/ Computer Arts Interactif 42 / CA 42.iso / pc / PC / logiciels / Retouche photo / Photoshop / data1.cab / Help / Aide / CSNSFix.js < prev    next >
Text File  |  2001-01-30  |  2KB  |  83 lines

  1. <!--
  2. //
  3. // $Name: hbh_03 $
  4. // $RCSfile: CSNSFix.js,v $
  5. // $Revision: 1.3 $
  6. //
  7. CSStopExecution = false;
  8. CSInit = new Array;
  9. function CSScriptInit() {
  10.   if(typeof(skipPage) != "undefined") {
  11.     if(skipPage) return; 
  12.   }
  13.   idxArray = new Array;
  14.   for(var i=0;i<CSInit.length;i++) {
  15.     idxArray[i] = i;
  16.   }
  17.   CSAction2(CSInit, idxArray);
  18. }
  19. CSStopExecution = false;
  20. function CSAction(array) { 
  21.   return CSAction2(CSAct, array);
  22. }
  23. function CSAction2(fct, array) { 
  24.   var result;
  25.   for (var i=0;i<array.length;i++) {
  26.     if(CSStopExecution) return false; 
  27.     var actArray = fct[array[i]];
  28.     if(actArray == null) return false; 
  29.     var tempArray = new Array;
  30.     for(var j=1;j<actArray.length;j++) {
  31.       if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
  32.         if(actArray[j][0] == "VAR") {
  33.           tempArray[j] = CSStateArray[actArray[j][1]];
  34.         }
  35.         else {
  36.           if(actArray[j][0] == "ACT") {
  37.             tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
  38.           }
  39.           else
  40.             tempArray[j] = actArray[j];
  41.         }
  42.       }
  43.       else
  44.         tempArray[j] = actArray[j];
  45.     }      
  46.     result = actArray[0](tempArray);
  47.   }
  48.   return result;
  49. }
  50. CSAct = new Object;
  51. function CSFixFct() {
  52.   var d = document; var w = window;
  53.   if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
  54.     d.location = d.location; 
  55.   }
  56. }
  57. function CSNSFix(action) { 
  58.   var d = document; var w = window;
  59.   if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
  60.     if (typeof d.cs == 'undefined') { 
  61.       d.cs = new Object;
  62.       d.cs.csFix = new Object; 
  63.     } 
  64.     else if (CSIsFrame (w) == true) {
  65.       CSFixFct();
  66.     }
  67.     d.cs.csFix.w = w.innerWidth;
  68.     d.cs.csFix.h = w.innerHeight; 
  69.     window.onresize = CSFixFct;
  70.   }
  71. }
  72. function CSIsFrame (window) {
  73.   var rootWindow = window.parent;
  74.   if (rootWindow == 'undefined') {
  75.     return false;
  76.   }
  77.   for (i = 0; i < rootWindow.frames.length; i++) {
  78.     if (window == rootWindow.frames[i]) return true;
  79.   }
  80.   return false;
  81. }
  82. // -->
  83.